<div class="modal fade in ip-box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true"
  id="update">
  <div class="modal-dialog modal-lg-f" role="document" style="margin:254px auto;">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title" id="myModalLabel">任务管理 — 修改</h4>
      </div>
      <div class="modal-body modal-body680">
        <form *ngIf="details" #newlyAddedForm="ngForm" (ngSubmit)="submitNewlyUpdate(newlyAddedForm.value)">
          <input type="text" name="taskId" class="hide" autocomplete="off" required #taskId=ngModel ngModel [(ngModel)]="details.taskId"/>
          <input type="text" name="createDate" class="hide" autocomplete="off" #createDate=ngModel ngModel  />
          <div class="form-group">
            <label class="col-xs-12 col-sm-3 control-label text-right">任务名称：</label>
            <div class="col-xs-12 col-sm-9">
              <input type="text" name="taskZhName" class="form-control" autocomplete="off" required #taskZhName=ngModel ngModel [(ngModel)]="details.taskZhName"
                placeholder="请输入任务名称" pattern="^[a-zA-Z\d\u4E00-\u9FA5_-]+$" />
              <label class="red required">*</label>
              <div *ngIf="taskZhName.invalid && ( taskZhName.touched)" class="error-alert">
                <div *ngIf="taskZhName.errors.required">
                  <small class="error">请输入任务名称</small>
                </div>
                <small class="error" *ngIf="taskZhName.errors?.pattern ">不能输入特殊符号,允许输入_-</small>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-xs-12 col-sm-3 control-label text-right">服务名称：</label>
            <div class="col-xs-12 col-sm-9">
              <input type="text" name="taskName" class="form-control" autocomplete="off" required #taskName=ngModel ngModel [(ngModel)]="details.taskName"
                placeholder="请输入服务名称" pattern="^[a-zA-Z\d\_-]+$" />
              <label class="red required">*</label>
              <div *ngIf="taskName.invalid && (taskName.touched)" class="error-alert">
                <div *ngIf="taskName.errors.required">
                  <small class="error">请输入服务名称</small>
                </div>
                <small class="error" *ngIf="taskName.errors?.pattern ">不能输入中文和特殊符号,允许输入_-</small>
              </div>
            </div>
          </div>
          <div class="form-group height-auto">
            <label class="col-xs-12 col-sm-3 control-label text-right">程序集名称：</label>
            <div class="col-xs-12 col-sm-9">
              <input type="text" name="assemblyName" class="form-control" autocomplete="off" required #assemblyName=ngModel ngModel [(ngModel)]="details.assemblyName"
                placeholder="请输入程序集名称" pattern="^[a-zA-Z\d\_.-]+$" />
              <label class="red required">*</label>
              <div *ngIf="assemblyName.invalid && ( assemblyName.touched)" class="error-alert">
                <div *ngIf="assemblyName.errors.required">
                  <small class="error">请输入程序集名称</small>
                </div>
                <small class="error" *ngIf="assemblyName.errors?.pattern ">不能输入中文和特殊符号,允许输入_.-</small>
              </div>
            </div>
          </div>
          <div class="form-group height-auto">
            <label class="col-xs-12 col-sm-3 control-label text-right">方法名：</label>
            <div class="col-xs-12 col-sm-9">
              <input type="text" name="methodName" class="form-control" autocomplete="off" required #methodName=ngModel ngModel [(ngModel)]="details.methodName"
                placeholder="请输入方法名" pattern="^[a-zA-Z\d\_-]+$" />
              <label class="red required">*</label>
              <div *ngIf="methodName.invalid && ( methodName.touched)" class="error-alert">
                <div *ngIf="methodName.errors.required">
                  <small class="error">请输入方法名</small>
                </div>
                <small class="error" *ngIf="methodName.errors?.pattern ">不能输入中文和特殊符号,允许输入_-</small>
              </div>
            </div>
          </div>
          <!-- <div class="form-group height-auto">
                <label class="col-xs-12 col-sm-3 control-label text-right">任务执行开始时间：</label>
                <div class="col-xs-12 col-sm-9">
                    <input type="text" name="startTime" class="pull-left form-control fillt"  autocomplete="off" #dp="bsDatepicker"placeholder="请选择执行时间" bsDatepicker  [(ngModel)]="details.startTime"/>
                    <label class="red required">*</label>
                </div>
          </div>
          <div class="form-group height-auto">
              <label class="col-xs-12 col-sm-3 control-label text-right">任务执行结束时间：</label>
              <div class="col-xs-12 col-sm-9">
                  <input type="text" name="endTime" class="pull-left form-control fill" autocomplete="off" #dp="bsDatepicker"  placeholder="请选择结束时间" bsDatepicker  [(ngModel)]="details.endTime"  />
                  <label class="red required">*</label>
              </div>
          </div>
          <div class="form-group height-auto">
              <label class="col-xs-12 col-sm-3 control-label text-right">执行间隔时间：</label>
              <div class="col-xs-12 col-sm-9">
                  <div class="col-xs-12 col-sm-9">
                    <input type="number" name="intervalTime" class="pull-left form-control fill" autocomplete="off" [(ngModel)]="details.intervalTime"/>
                  </div>
                  <div class="col-xs-12 col-sm-3">
                      <select name="intervalUnit" required ngModel [(ngModel)]="details.intervalUnit">
                          <option value="">请选择</option>
                          <option value="0">天</option>
                          <option value="1">小时</option>
                          <option value="2">分钟</option>
                          <option value="3">秒</option>
                      </select>
                  </div>
              </div>
              <label class="red required">*</label>
              
          </div> 
          <div class="form-group height-auto">
            <label class="col-xs-12 col-sm-3 control-label text-right">任务类型：</label>
            <div class="col-xs-12 col-sm-9">
              <select name="type" required ngModel [(ngModel)]="details.type">
                <option value="">请选择</option>
                <option value="0">重复</option>
                <option value="1">一次</option>
              </select>
            </div>
          </div>-->
          <div class="form-group height-auto">
            <label class="col-xs-12 col-sm-3 control-label text-right">任务状态：</label>
            <div class="col-xs-12 col-sm-9">
              <!-- <select name="taskStatus" required ngModel [(ngModel)]="details.taskStatus">
                  <option value="">请选择</option>
                  <option value="1">已开启</option>
                  <option value="0">已关闭</option>
                </select> -->
              <label class="toggle toggle-positive">
                <input type="checkbox" name="taskStatus" #taskStatus=ngModel [(ngModel)]="details.taskStatus" />
                <div class="track">
                  <div class="tit" *ngIf="details.taskStatus">已开启</div>
                  <div class="tit right" *ngIf="!details.taskStatus">已关闭</div>
                  <div class="handle"></div>
                </div>
              </label>
            </div>
          </div>
          <div class="form-group height-auto">
            <label class="col-xs-12 col-sm-3 control-label text-right">表达式：</label>
            <div class="col-xs-12 col-sm-9">

              <input type="text" name="cronExpress" class="form-control" autocomplete="off" required #cronExpress=ngModel [(ngModel)]="details.cronExpress"
                pattern="^[A-Za-z0-9\d\u4E00-\u9FA5 ,#/*?]+$" placeholder="表达式不能为汉字，允许输入 ,#/*?" />
              <label class="red required">*</label>
              <div *ngIf="cronExpress.invalid && (cronExpress.touched)" class="error-alert">
                <div *ngIf="cronExpress.errors.required">
                  <small class="error">请输入表达式</small>
                </div>
                <small class="error" *ngIf="cronExpress.errors?.pattern ">请输入正确的表达式</small>
              </div>
            </div>
          </div>
          <div class="form-group height-auto">
            <label class="col-xs-12 col-sm-3 control-label text-right">说明：</label>
            <div class="col-xs-12 col-sm-9">
              <textarea rows="5" type="text" name="remark" class="form-control" ngModel [(ngModel)]="details.remark">
              </textarea>
            </div>
          </div>
          <div class="modal-footer modal-footer-tongy">
            <button type="button" class="btn btn-fff" data-dismiss="modal">取消</button>
            <button type="submit" class="btn btn-primary" [disabled]="newlyAddedForm.invalid"><span class="glyphicon glyphicon-pencil"></span> 修改
            </button>
            <!-- [disabled]="resTable.invalid || assemblyName.invalid || name.invalid" -->
          </div>
        </form>
      </div>
    </div>
  </div>
</div>